import { createRouter, createWebHashHistory } from "vue-router";

const router = createRouter({
    history: createWebHashHistory(),
    routes: [{
            path: "/",
            redirect: "/login",
        },
        {
            path: "/login",
            name: "login",
            component: () =>
                import ("../views/login.vue"),
        },
        {
            path: "/home",
            name: "home",
            component: () =>
                import ("../views/home.vue"),
            redirect: "/wellcom",
            children: [{
                    path: "/wellcom",
                    name: "wellcom",
                    component: () =>
                        import ("../views/wellcom.vue"),
                },
                {
                    path: "/users",
                    name: "users",
                    component: () =>
                        import ("../views/users.vue"),
                },
                {
                    path: "/roles",
                    name: "roles",
                    component: () =>
                        import ("../views/roles.vue"),
                },
                {
                    path: "/rights",
                    name: "rights",
                    component: () =>
                        import ("../views/rights.vue"),
                },
                {
                    path: "/goods",
                    name: "goods",
                    component: () =>
                        import ("../views/goods.vue"),
                },
                {
                    path: "/goodsadd",
                    name: "goodsadd",
                    component: () =>
                        import ("../views/goodsadd.vue"),
                },
                {
                    path: "/goodsedit",
                    name: "goodsedit",
                    component: () =>
                        import ("../views/goodsedit.vue"),
                },
                {
                    path: "/params",
                    name: "/params",
                    component: () =>
                        import ("../views/params.vue"),
                },
                {
                    path: "/categories",
                    name: "/categories",
                    component: () =>
                        import ("../views/categories.vue"),
                },
                {
                    path: "/orders",
                    name: "/orders",
                    component: () =>
                        import ("../views/orders.vue"),
                },
                {
                    path: "/reports",
                    name: "/reports",
                    component: () =>
                        import ("../views/reports.vue"),
                },
            ],
        },
    ],
});

export default router;